package com.example.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @TableName car
 */
@TableName(value ="car")
@ApiModel("车辆详情信息")
@Data
public class Car implements Serializable {
    @TableId(value = "carId",type = IdType.AUTO)
    private Long carid;
    @TableField("carName")
    @ApiModelProperty("名称")
    private String carname;
    @TableField("carPrice")
    private BigDecimal carprice;
    @TableField("carMileage")
    private String carmileage;
    @TableField("carBuyTime")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date carbuytime;
    @TableField("carType")
    private Long cartype;
    @TableField("carStatus")
    private Integer carstatus;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Car other = (Car) that;
        return (this.getCarid() == null ? other.getCarid() == null : this.getCarid().equals(other.getCarid()))
            && (this.getCarname() == null ? other.getCarname() == null : this.getCarname().equals(other.getCarname()))
            && (this.getCarprice() == null ? other.getCarprice() == null : this.getCarprice().equals(other.getCarprice()))
            && (this.getCarmileage() == null ? other.getCarmileage() == null : this.getCarmileage().equals(other.getCarmileage()))
            && (this.getCarbuytime() == null ? other.getCarbuytime() == null : this.getCarbuytime().equals(other.getCarbuytime()))
            && (this.getCartype() == null ? other.getCartype() == null : this.getCartype().equals(other.getCartype()))
            && (this.getCarstatus() == null ? other.getCarstatus() == null : this.getCarstatus().equals(other.getCarstatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCarid() == null) ? 0 : getCarid().hashCode());
        result = prime * result + ((getCarname() == null) ? 0 : getCarname().hashCode());
        result = prime * result + ((getCarprice() == null) ? 0 : getCarprice().hashCode());
        result = prime * result + ((getCarmileage() == null) ? 0 : getCarmileage().hashCode());
        result = prime * result + ((getCarbuytime() == null) ? 0 : getCarbuytime().hashCode());
        result = prime * result + ((getCartype() == null) ? 0 : getCartype().hashCode());
        result = prime * result + ((getCarstatus() == null) ? 0 : getCarstatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", carid=").append(carid);
        sb.append(", carname=").append(carname);
        sb.append(", carprice=").append(carprice);
        sb.append(", carmileage=").append(carmileage);
        sb.append(", carbuytime=").append(carbuytime);
        sb.append(", cartype=").append(cartype);
        sb.append(", carstatus=").append(carstatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}